var thisad;
var userarray=new Array();
var companyarray=new Array();
var AdminSummaryProxy = Objs("model.AdminSummaryProxy",
	Proxy,
{
	initialize: function( name,lists)
	{ 
		AdminSummaryProxy.$super.initialize.call( this, name,lists);
		thisad=this;
	},	
	load:function()
	{
		var limit=new Object();
		limit.start=0;
		limit.count=5;
		limit.searchkey='';
		$.ajax({
				type: "POST",
				url:"../services/SummaryService.php?action=getsummarry",
				data:limit,
				success: function(data,status) {
				var summarydata= eval('(' + data + ')');
				for(i=0;i<summarydata.userlist.length;i++)
				{
					var uservo=new UserVO();
					
					uservo.fname=summarydata.userlist[i].first_name;
					uservo.lname=summarydata.userlist[i].last_name;
					uservo.email=summarydata.userlist[i].email;
					uservo.type=summarydata.userlist[i].admin_type;
					uservo.admin_id=summarydata.userlist[i].admin_id;
					userarray.push(uservo);
				}
				for(i=0;i<summarydata.company_details.length;i++)
				{
					var companyvo=new CompanyVO();
					companyvo.company_name=summarydata.company_details[i].company_name;
					companyvo.company_type=summarydata.company_details[i].company_type;
					companyvo.street=summarydata.company_details[i].street;
					companyvo.email=summarydata.company_details[i].email;
					companyvo.city=summarydata.company_details[i].city;
					
					companyarray.push(companyvo);
				}
				
				//for(i=0;i<summarydata.userlist.length;i++)
				//{
				thisad.sendNotification( NotificationNames.SUMMARYDATA, 'success' );	
					
				},
				error:function(error,response){
				}
			});
	},
	getuserarray:function()
	{
	return userarray;
	},
	getcompanyarray:function()
	{
	return companyarray;
	}
});
 